package com.xiangge.lianxi;

import java.util.Arrays;
import java.util.Scanner;

public class Demo1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        double[][] arr = new double[][]{{0,0,0},{0,0,0,0},{0,0,0,0,0}};
        double[] sum = new double[arr.length];
        double[] avg = new double[arr.length];
        for (int i = 0; i < arr.length; i++) {
            double[] arr2 = arr[i];
            for (int j = 0; j < arr2.length; j++) {
                System.out.print("请输入第"+(i+1)+"个班第"+(j+1)+"个学生的成绩：");
                arr2[j] = input.nextDouble();
                sum[i] = sum[i]+arr2[j];
            }
            avg[i] = sum[i]/arr2.length;
            System.out.println("--------------------------");


        }
        System.out.println("三个班总分分别是"+Arrays.toString(sum));
        System.out.println("三个班总平均分分别是"+Arrays.toString(avg));
    }
}
